import { checkStr } from "@/utils/judge";
// import url from "@/axios/url";
import { getDict } from "@/api/common";
import { exportUrl } from '@/api/materials/bomBuyer.js'
// const { mesUrl } = url();
let vm = null;
const sendThis = (_this) => {
  vm = _this;
};
export { sendThis };
//存放柜区域
// 列表头按钮配置
export const operateList = {
  data () {
    const _this = this;
    return {
      operateList: [
        // {
        //   name: $i18n.t("common.export"),
        //   type: "primary",
        //   icon: "el-icon-download",
        //   handleName: "download"
        // },
      ]
    };
  },
};
// 行末按钮配置
export const rowConfig = [
  {
    name: $i18n.t("common.details") + '/信息补充',
    type: "primary",
    class: "row-btn-primary",
    handleName: "detail", // 点击时返回的标识
    disabled: (row) => row.demandStatus == '已取消',
  },
  {
    name: $i18n.t("bomBuyer.reinquiry"),
    type: "primary",
    class: "row-btn-primary",
    handleName: "reinquiry", // 点击时返回的标识
    disabled: (row) => row.demandStatus != '未响应',
  }
];

// 详情搜索条件配置
export const detailSearchConfig = {
  data () {
    const _this = this;
    return {
      detailSearchConfig: {
        inline: true,
        formDesc: {
          orderCode: {
            type: "input",
            layout: 6,
            label: '定向集采需求单编码',
          },
          materialName: {
            type: "input",
            layout: 6,
            label: $i18n.t("bomBuyer.materialName"),
          },
          status: {
            type: "select",
            layout: 6,
            label: $i18n.t("common.status"),
            prop: {
              value: "value",
              text: "description",
            },
            options: async () => {
              const list = await getDict('buyer_direct_status');
              return list.data.result;
            },
          },
          dateRanger: {
            layout: 6,
            type: "daterange",
            label: $i18n.t("bomBuyer.createTime"),
            attrs: {
              valueFormat: "yyyy-MM-dd",
              searchArrKey: ["startTime", "endTime"]
            }
          },
        },
      },
    };
  },
};
